import matplotlib.pyplot as plt
import numpy as np

# 通过两个坐标 (0,0) 到 (6,100) 来绘制一条线
def fun1():
    xpoints = np.array([0, 6])
    ypoints = np.array([0, 100])

    plt.plot(xpoints, ypoints)
    plt.show()

# 绘制坐标 (1, 3) 和 (8, 10) 的两个点
def fun2():
    xpoints = np.array([1, 8])
    ypoints = np.array([3, 10])

    plt.plot(xpoints, ypoints, 'o')
    plt.show()

# 绘制一条不规则线，坐标为 (1, 3) 、 (2, 8) 、(6, 1) 、(8, 10)
def fun3():
    xpoints = np.array([1, 2, 6, 8])
    ypoints = np.array([3, 8, 1, 10])

    plt.plot(xpoints, ypoints)
    plt.show()

# 绘制一个正弦和余弦图
def fun4():
    x = np.arange(0, 4*np.pi, 0.1)
    y = np.sin(x)
    z = np.cos(x)
    plt.plot(x, y, x, z)
    plt.show()

if __name__ == '__main__':
    fun4()